<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="static/stylesheets/bootstrap.min.css" rel="stylesheet">
    <link href="static/stylesheets/base.css" rel="stylesheet">
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
    <div id="wrapper">
        <!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div id="slimScrollDiv" class="slimScrollDiv">
                <div class="sidebar-collapse" style="width: auto; height: 100%">
                    <ul class="nav" id="side-menu">
                        <li class="nav-header">
                            <div class="dropdown profile-element">
                                <span><img alt="image" class="img-circle" src="static/imgs/profile_small.jpg"></span>
                                <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                    <span class="clear">
                                        <span class="block m-t-xs"><strong class="font-bold">Beaut-zihan</strong>
                                        </span>
                                        <span class="text-muted text-xs block">超级管理员<b class="caret"></b></span>
                                    </span>
                                </a>
                                <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                    <li><a class="J_menuItem" href="#" data-index="0">修改头像</a>
                                    </li>
                                    <li><a class="J_menuItem" href="#" data-index="1">个人资料</a>
                                    </li>
                                    <li><a class="J_menuItem" href=#" data-index="2">联系我们</a>
                                    </li>
                                    <li><a class="J_menuItem" href="#" data-index="3">信箱</a>
                                    </li>
                                    <li class="divider"></li>
                                    <li><a href="#">安全退出</a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                        <li>
                            <a class="menu" active="true" href="#" second-level="false">
                                <i class="glyphicon glyphicon-home" ></i>
                                <span class="nav-label" style="margin-left: 8px">主页</span>
                                <span class="glyphicon glyphicon-menu-left menu-right"></span>
                            </a>
                            <ul class="nav nav-second-level hide">
                                <li>
                                    <a class="J_menuItem" href="#" data-index="0">主页示例一</a>
                                </li>
                                <li>
                                    <a class="J_menuItem" href="#" data-index="5">主页示例二</a>
                                </li>
                                <li>
                                    <a class="J_menuItem" href="#" data-index="6">主页示例三</a>
                                </li>
                                <li>
                                    <a class="J_menuItem" href="#" data-index="7">主页示例四</a>
                                </li>
                                <li>
                                    <a href="#" target="_blank">主页示例五</a>
                                </li>
                            </ul>
                            <a class="menu" active="false" href="#" second-level="true">
                                <i class="glyphicon glyphicon-cog"></i>
                                <span class="nav-label" style="margin-left: 8px">基本设置</span>
                                <span class="glyphicon glyphicon-menu-left menu-right"></span>
                            </a>
                            <ul class="nav nav-second-level hide">
                                <li>
                                    <a class="J_menuItem" href="#" data-index="0">机房管理</a>
                                </li>
                                <li>
                                    <a class="J_menuItem" href="#" data-index="5">人员管理</a>
                                </li>
                                <li>
                                    <a class="J_menuItem" href="#" data-index="6">项目组管理</a>
                                </li>
                            </ul>
                            <a class="menu" active="false" href="#" second-level="true">
                                <i class="glyphicon glyphicon-cog"></i>
                                <span class="nav-label" style="margin-left: 8px">菜单三</span>
                                <span class="glyphicon glyphicon-menu-left menu-right"></span>
                            </a>
                            <ul class="nav nav-second-level hide">
                                <li>
                                    <a class="J_menuItem" href="#" data-index="0">子菜单一</a>
                                </li>
                                <li>
                                    <a class="J_menuItem" href="#" data-index="5">子菜单二</a>
                                </li>
                                <li>
                                    <a class="J_menuItem" href="#" data-index="6">子菜单三</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
        <!--左侧导航结束-->
        <!--右侧主体开始-->
        <div id="page-wrapper">
            <!--右侧navbar开始-->
            <nav class="navbar navbar-inverse navbar-fixed-top navbar-static-top">
                <div class="container-fluid">
                    <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                </div>
                <div id="navbar" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="#">Settings</a></li>
                        <li class="dropdown">
                            <a id="dLabel" data-target="#" href="http://example.com" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                                消息
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu" aria-labelledby="dLabel">
                               <li role="presentation" class="active" style="background-color: red;"><a href="#" >无</a></li>
                                <li role="presentation" class="active" style="background-color: red;"><a href="#" >无</a></li>
                            </ul>
                        </li>
                    </ul>
                    <form class="navbar-form navbar-right">
                        <input type="text" class="form-control" placeholder="Search...">
                    </form>
                </div>
            </nav>
            <!--右侧navbar结束-->
        </div>
        <!--右侧主体结束-->
    </div>
    <script src="static/js/jquery.min.js?v=2.1.4"></script>
    <script src="static/js/bootstrap.min.js?v=3.3.6"></script>
    <script>
        $(function(){
            $('.menu').click(function(){
//                var second_menu =
                console.log($(this).attr('second-level'));
                if($(this).attr('second-level') == 'true'){
//                    console.log($(this).attr('scond-level'))
//                    $(this).('.menu-right').addClass('glyphicon-menu-down')


//                    $(this).next().removeAttr('active');
                    if($(this).attr('active')=='false'){
                        $(this).attr('active','true');
                        $(this).next().removeClass('hide');
                        $(this).addClass('nav-active');
                        $(this).css('color','#fff')
                        $(this).children('.menu-right').removeClass('glyphicon-menu-left')
                        $(this).children('.menu-right').addClass('glyphicon-menu-down')

                    }
                    else{
                        $(this).attr('active','false');
                        $(this).next().addClass('hide');
                        $(this).removeClass('nav-active')
                        $(this).css('color','')
                        $(this).children('.menu-right').removeClass('glyphicon-menu-down')
                        $(this).children('.menu-right').addClass('glyphicon-menu-left')
                    }
                }
//                $(this).children('.menu-right').removeClass('glyphicon-menu-left')
//                $(this).children('.menu-right').addClass('glyphicon-menu-down')
//                $(this).attr('second-level')
//                console.log()

            });
        })
    </script>
</body>
</html>